import api from '@/http/index'

class Api {
    /* 获取表格列表 */
    static getTablesList(data) {
        return new Promise((resolve, reject) => {
            api.get('/api/Delivery/GetGridJson', data).then((res) => {
                resolve(res);
            }).catch(err => {
                reject(err)
            })
        });
    }
    /* 待配送商品明细 */
    static getProjuctDetail(data) {
        return new Promise((resolve, reject) => {
            api.get('/api/PurchaseOrdersDetail/GetDetails', data).then((res) => {
                resolve(res);
            }).catch(err => {
                reject(err)
            })
        });
    }
    /* 新建配送单 */
    static addTablesItem(data) {
        return new Promise((resolve, reject) => {
            api.post('/api/Delivery/SubmitForm', data).then((res) => {
                resolve(res);
            }).catch(err => {
                reject(err)
            })
        });
    }
    /* 删除 */
    static deleteItem(data) {
        return new Promise((resolve, reject) => {
            api.get('/api/Delivery/DeleteForm', data).then((res) => {
                resolve(res);
            }).catch(err => {
                reject(err)
            })
        });
    }
    /* 根据id获取信息 */
    static getItemInfo(data) {
        return new Promise((resolve, reject) => {
            api.get('/api/Delivery/GetForm', data).then((res) => {
                resolve(res);
            }).catch(err => {
                reject(err)
            })
        });
    }
}

export default Api

